<?php
	require_once("header.php");
	
	$id=request('id',false,true);
	if(!$id)return false;
	
	$boss_object=new boss();
	$info=$boss_object->_car_info($id);
	if(!$info)return false;
	
	$binfo=$boss_object->admin_boss_info($info['uid']);
?>

	<script type="text/javascript" charset="utf-8">
		loader.file({
			plugin:['validform/main','dialog/main','my97/wdatepicker'],
			skincss:['list']
		})
		
		function agree(){
			$.post("/handle.php",$("#form1").serialize(),function(res){
				if(res.state){					
					parent.change(res.info);
					return;
				}
				alert(res.msg);
				},'json');            
		}
	</script>
	<style type="text/css">
		.table td a.hover{display: line-block;background: #60D277;color: #ffffff;padding:5px;}
	</style>
</head>
<body>
	<div class="main">
      <form action="/handle.php" method="post" id="form1">
      <input type="hidden" name="h" value="device/edit">
      <input type="hidden" name="id" value="<?php echo $id?>">

		<table cellpadding="0" cellspacing="1" border="0" class="table" style="width:98%;">
			
			<tr>
			    <td>老板姓名</td>
				<td style="text-align: left">
					<strong><?php echo $binfo['name']?></strong>
				</td>
			    <td>联系电话</td>			
				<td style="text-align: left">
					<?php echo $binfo['phone'];?>
				</td>			
			</tr>
			
			<tr>
			    <td>车型</td>			
				<td style="text-align: left">
				<?php echo $info['car']?>
			     </td>				
			    <td>车牌号</td>			
				<td style="text-align: left">
				    <?php echo $info['carno']?>
			    </td>
			</tr>				
			
			<tr>
			    <td>车手</td>			
				<td style="text-align: left">
					<?php echo $info['linkman']?>
				</td>
			    <td>车手电话</td>			
				<td style="text-align: left">
				    <?php echo $info['phone']?>
				</td>								
			</tr>	
			
			<tr>
			    <td>绑定设备</td>			
				<td style="text-align: left">
					<?php echo $info['code']?>
				</td>
			    <td>绑定时间</td>			
				<td style="text-align: left">
				    <?php echo date('Y-m-d H:i:s',$info['bindtime']);?>
				</td>								
			</tr>	
			
			<?php 
			  if($info['code']){
			?>
			<tr>
			    <td>到期时间</td>			
				<td colspan=3 style="text-align: left">												
				    <?php echo date('Y-m-d H:i:s',$info['endtime']);?>
				    <?php
				      if($info['endtime']<time()){ 
				    ?>
				    <font color="red">已到期</font>
				    <?php 
				      }
				    ?>
				</td>								
			</tr>				
			<?php
              }
			?>
						
			<tr>
			    <td>审核状态</td>			
				<td colspan=3 style="text-align: left">
					<?php echo 1==$info['state']?"启用":"<font color='red'>禁用</font>"; ?>&nbsp;
					<?php 
					  if(1==$info['state']){
					?>
					<a href="/handle.php?h=boss/admin_carstate&id=<?php echo $info['id']?>&state=0">点击禁用</a>
					<?php
                      }else{
					?>
					<a href="/handle.php?h=boss/admin_carstate&id=<?php echo $info['id']?>&state=1">点击启用</a>
					<?php } ?>
				</td>			    								
			</tr>							
		
		</table>      
      
	</form>	
	</div>
</body>
</html>